package com.wz.dao;

import com.wz.pojo.Block;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Repository
public interface BlockDao  {

/*
* insert into block(id,number,hash,parentHash,miner,difficulty,size,gasLimit,gasUsed,timestamp) values(1,1,'sss','qqq','wwww',2,3,4,5,6)
* */
	
	@Insert("insert into block(number,hash,parentHash,miner,difficulty,size,gasLimit,gasUsed,timestamp) values(#{number},#{hash},#{parentHash},#{miner},#{difficulty},#{size},#{gasLimit},#{gasUsed},#{timestamp})")
	@Options(useGeneratedKeys = true, keyProperty = "number", keyColumn = "number")/*增加这个注解插入记录后会返回自增长的id*/
	void insertBlock(Block block);
}
